<template>
	<view class="page-wrapper">	
			<view class="card_item" v-for="(item , index) in cardList">
				 <view style="display: flex;justify-content: space-between;">	
					<text>卡号：{{item.card_no}} <text style="font-size: 22rpx;color: #999;margin-left: 20rpx;">({{item.status_desc}})</text></text>
					<text style="color:orange">￥{{item.balance}}</text>
				</view> 
				<view style="display: flex;justify-content: space-between;" v-if="item.card_project_name">
					<text>折扣项目：{{item.card_project_name}}</text>
				</view> 
				<view>生效时间：{{item.create_time}}</view>
				<view>截至日期：{{item.time_desc}}</view>
			</view>
	</view>
</template>

<script>
import { api } from '@/util/api.js';
export default {
	data() {
		return {
			cardList: []
		};
	},
	onLoad(e) {
		 this.getCard()
	},
	methods: {
		getCard(){
			api.getCardList({}, res=>{
				if(res.code == 0){
					console.log(res.data , 'data')
					this.cardList = res.data
				}
			})
			
		}
		
	}
};
</script>

<style scoped>
.page-wrapper {
	width: 100%;
	padding: 40rpx;
	box-sizing: border-box;
}
.card_item{
	padding: 20rpx;
	background: #eee;
	border-radius: 24rpx;
	margin-bottom: 30rpx;
	font-size: 28rpx;
	
}
</style>
